import * as THREE from 'three';
const model = new THREE.Group();
const geometry = new THREE.SphereGeometry( 5, 32, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const sphere1 = new THREE.Mesh( geometry, material );
sphere1.position.set(-50,50,0)
model.add(sphere1)
// 表示速度
const v = new THREE.Vector3(10,0,10);
const clock = new THREE.Clock();
// 记录原始的位置
const pos0 = sphere1.position.clone();
let t = 0
function loop (){
    // clock.getDelta()两帧的时间间隔
    t= t+ clock.getDelta()
    const newPos = pos0.clone().add(v.clone().multiplyScalar(t))
    sphere1.position.copy(newPos)
   requestAnimationFrame(loop)
}
loop()
export default {model};